<template>
  <div>
    <div>
      <!-- 分页 -->
      <div class="tab_company_out">
        <h1 class="title">重庆医科大学附属第二医院</h1>
        <h2 class="sontitle">高值耗材清单（2022新版）</h2>
        <table cellpadding="0" cellspacing="0">
          <div class="titleDiv">手术名称:</div>
          <div class="titleDiv titleBox">
            <span>科室: </span>
            <span>床号: </span>
            <span>姓名: </span>
            <span>住院号: </span>
          </div>
          <tr>
            <th width="5%">序号</th>
            <th width="20%">项目编码</th>
            <th width="25%">项目名称</th>
            <th width="25%">规格型号</th>
            <th width="10%">单价</th>
            <th width="5%">数量</th>
            <th width="15%">备注</th>
          </tr>
          <!-- 每页显示onePageRow条数据 -->
          <tr v-for="(item, index) in tableData" :key="index">
            <td>{{ index + 1 }}</td>
            <td>{{ item.code }}</td>
            <td>{{ item.projectname }}</td>
            <td>{{ item.number }}</td>
            <td>{{ item.price }}</td>
            <td>{{ item.count }}</td>
            <td>{{ item.remark }}</td>
          </tr>
        </table>
        <div class="remarkDiv">
            <div>备注:</div>
            <div>植入类或单价≥1000元的高耗需贴条形码,一式两份,一份存病例,一份设备溯源。</div>
            <div>申请记账编码（  ）,开通收费权限（  ）。</div>
        </div>
        <div class="footDiv">
            <div>经过手术医生评估病情,为减少并发症的发生,达到治疗目的,主刀医生根据病情需要选择上述材料实施手术,而由此产生的相关费用由我们自行承担。</div>
            <div style="margin-top:20px;">
              <span style="margin-left:30px">签字:</span>
              <span style="margin-left:250px">与患者关系:</span>
            </div>
            <div style="margin-top:20px;">
              <span style="margin-left:30px">手术医生:</span>
              <span style="margin-left:250px">手术护士:</span>
            </div>
            <div style="margin-top:20px; margin-left:400px;">
              <span>年</span>
              <span>月</span>
              <span>日</span>
            </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "printUser",

  // 制作打印模版组件时，props区域尽量保留。
  props: {
    // 接受的打印数据
    tableData: {},
    // 每页多少行
    onePageRow: {
      type: Number,
      default: 5,
    },
    // 是否插入空白行
    blankLines: {
      type: Boolean,
      default: true,
    },
    //getChineseNumber: Function, // 求数字的中文写法，从easyPrint组件传入
  },

  computed: {
    pages() {
      console.log(this.tableData);
      // 求当前数据能打印的页数
      /* var pages_ = Math.ceil(this.tableData.detail.length / this.onePageRow); // 向上取整数*/
      // return pages_ <= 0 ? 1 : pages_;

      return 1;
    },

    // chineseTotal() {
    //   // 计算中文合计，如果忘记传入
    //   return this.getChineseNumber != null
    //     ? this.getChineseNumber(this.tableData.total_amount)
    //     : "您还没有传入getChineseNumber";
    // },
  },
  methods: {
    test() {
      console.log("21111111111111");
      console.log("test");
    },
  },
};
</script>

<style scoped>
.titleDiv {
  width: 734px;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  text-align: left;
  height: 50px;
  line-height: 50px;
  margin: auto;
  font-weight: bold;
}
.remarkDiv{
  width: 734px;
  border-bottom: 1px solid #000;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  text-align: left;
  height: 100px;
  margin: auto;
}
.footDiv{
  width: 734px;
  border-bottom: 1px solid #000;
  border-left: 1px solid #000;
  border-right: 1px solid #000;
  text-align: left;
  height: 150px;
 
  margin: auto;

}
.titleBox {
  display: flex;
  justify-content: space-between;
}
.titleBox span {
  display: block;
  width: 20%;
}
* {
  padding: 0;
  margin: 0;
  list-style-type: none;
  /* font-family: "微软雅黑"; */
  font-size: 12px;
}

.tab_company_out {
  text-align: center;
  width: 100%;
  margin: auto;
  page-break-after: always;
}
.title {
  font-size: 25px;
  font-family: "宋体";
}
.sontitle {
  font-size: 20px;
  font-family: "黑体";
}
h3 {
  font-size: 14px;
}
.dan {
  text-align: center;
  position: relative;
}

.dan span {
  position: absolute;
  right: 0;
}
p {
  overflow: hidden;
  padding: 10px 0;
}
p span {
  float: left;
}
p span ins {
  text-decoration: underline;
}
p time {
  float: right;
}
table {
  margin: auto;
  width: 734px;
  border: none;
  border-bottom: 1px solid #000;
  
}
table tr td {
  border: 1px solid #000;
  border-bottom: none;
  border-right: none;
  height: 20px;
  line-height: 20px;
}
table tr td:last-of-type,
table tr th:last-of-type {
  border-right: 1px solid #000;
}
table tr th {
  border-top: 1px solid #000;
  border-left: 1px solid #000;
  height: 22px;
  line-height: 22px;
  font-size: 12px;
}
table tr th:nth-child(2) {
  width: 0;
}
.lu {
  display: inline-block;
  padding-top: 10px;
}
.lu li {
  float: left;
  text-align: left;
  margin-right: 15px;
}
.lu li label {
  width: 100px;
  display: inline-block;
}
.lu li:last-of-type {
  margin-right: 0;
}
@page {
  size: auto A4 landscape;
  margin: 3mm;
}
</style>